<?php
/**
 * Created by PhpStorm.
 * User: sunyang
 * Date: 2017/1/22
 * Time: 11:17
 */

class Controller{
    var $smarty=null;
    public function __construct(){
        $this->startcontroller();
    }
    public function startcontroller(){
        static $smarty = null;
        if($smarty===null){
            include_once(ROOTPATH.'/lib/smarty/Smarty.class.php');
            $smarty = new Smarty;
            $smarty->template_dir = ROOTPATH.'/view/'.APPNAME;

            //$smarty->config_dir = ROOTPATH.'/app/'.APPNAME.'/configs';
            $smarty->compile_dir = ROOTPATH.'/temp/'.APPNAME;
            $smarty->cache_dir = ROOTPATH.'/temp/'.APPNAME.'/cache';
            $smarty -> caching = false;
            $smarty->cache_lifetime = 120;
            //$smarty -> left_delimiter="<{";
            //$smarty -> right_delimiter="}>";
        }
        $this->smarty = $smarty;
    }

}